

$(function(){
    $("#repairTypeForm").Validform({
    tiptype:2,
    ajaxPost:true,
    showAllError:true,
    beforeSubmit:function(curform){
      curform.ajaxSubmit({
        type:'POST',
        url:'/index.php?m=Service&c=repairType&a=edit',
        success:function(data){
          layer.msg("修改成功");
                var index = parent.layer.getFrameIndex(window.name);
                setTimeout(function(){
                       parent.layer.close(index);
                },1000);
                 parent.location.reload();
              }
        });
      return false;
    }
  });
    $("#repairTypeAddForm").Validform({
    tiptype:2,
    ajaxPost:true,
    showAllError:true,
    beforeSubmit:function(curform){
      curform.ajaxSubmit({
        type:'POST',
        url:'/index.php?m=Service&c=repairType&a=add',
        success:function(data){
          layer.msg("添加成功");
                var index = parent.layer.getFrameIndex(window.name);
                setTimeout(function(){
                       parent.layer.close(index);
                },1000);
                 parent.location.reload();
              }
        });
      return false;
    }
  });


    $(document).on("change",".addPid",function(){
        var level=parseInt($(".addPid option:selected").attr("level"))+1;
        $(".levelId").attr("value",level);
    });
});